package Email.auto.checker;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class TrayListener extends MouseAdapter{

	/**
	 * tray: Reference to SystemTray instance
	 */
	private Tray tray;
	
	/**
	 * Constructor of TrayListener
	 * @param t: System Tray reference
	 */
	public TrayListener(Tray t){
		this.tray = t;
	}
	
	
	/**
	 * Mouse Click event: this event will be called when click is performed on SystemTray icon
	 */
	@Override
	public void mouseClicked(MouseEvent e) {
		super.mouseClicked(e);
		tray.getPopup().setLocation(e.getX(), e.getY());
		tray.getPopup().setInvoker(tray.getPopup());
		tray.getPopup().setVisible(true);
	
	}

}
